package com.example.bean;

import java.util.Date;

/**
 * 药材JavaBean（实体类）
 * 符合JavaBean规范：
 * 1. 公共类
 * 2. 无参构造函数
 * 3. 私有属性
 * 4. getter/setter方法
 */
public class Medicine {
    private Integer id;                 // 记录id
    private String medicineNo;          // 药材编号
    private String medicineName;        // 中药名
    private String alias;               // 别名
    private String source;              // 来源
    private String environment;         // 生长环境分布
    private String natureFlavor;        // 性味
    private String mainFunction;        // 主治功能
    private String usageDosage;         // 用法用量
    private Date createTime;            // 创建时间
    private Date updateTime;            // 更新时间

    /**
     * 无参构造函数（JavaBean规范要求）
     */
    public Medicine() {
    }

    /**
     * 全参构造函数
     */
    public Medicine(Integer id, String medicineNo, String medicineName, String alias, 
                   String source, String environment, String natureFlavor, 
                   String mainFunction, String usageDosage, Date createTime, Date updateTime) {
        this.id = id;
        this.medicineNo = medicineNo;
        this.medicineName = medicineName;
        this.alias = alias;
        this.source = source;
        this.environment = environment;
        this.natureFlavor = natureFlavor;
        this.mainFunction = mainFunction;
        this.usageDosage = usageDosage;
        this.createTime = createTime;
        this.updateTime = updateTime;
    }

    // Getter和Setter方法
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getMedicineNo() {
        return medicineNo;
    }

    public void setMedicineNo(String medicineNo) {
        this.medicineNo = medicineNo;
    }

    public String getMedicineName() {
        return medicineName;
    }

    public void setMedicineName(String medicineName) {
        this.medicineName = medicineName;
    }

    public String getAlias() {
        return alias;
    }

    public void setAlias(String alias) {
        this.alias = alias;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getEnvironment() {
        return environment;
    }

    public void setEnvironment(String environment) {
        this.environment = environment;
    }

    public String getNatureFlavor() {
        return natureFlavor;
    }

    public void setNatureFlavor(String natureFlavor) {
        this.natureFlavor = natureFlavor;
    }

    public String getMainFunction() {
        return mainFunction;
    }

    public void setMainFunction(String mainFunction) {
        this.mainFunction = mainFunction;
    }

    public String getUsageDosage() {
        return usageDosage;
    }

    public void setUsageDosage(String usageDosage) {
        this.usageDosage = usageDosage;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "Medicine{" +
                "id=" + id +
                ", medicineNo='" + medicineNo + '\'' +
                ", medicineName='" + medicineName + '\'' +
                ", alias='" + alias + '\'' +
                ", source='" + source + '\'' +
                ", environment='" + environment + '\'' +
                ", natureFlavor='" + natureFlavor + '\'' +
                ", mainFunction='" + mainFunction + '\'' +
                ", usageDosage='" + usageDosage + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}

